python program to count number of times a character occurs in a string